/*
    1.定义枚举类，枚举出日志等级
    2，提供转换接口：将枚举转换为对应字符串
*/
#ifndef __M_LEVEL_H__
#define __M_LEVEL_H__
namespace kaizi
{
    class LogLevel
    {
    public:
        enum class value
        {
            UNKONW=0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };
        static const char*toString(LogLevel::value level)//传入一个具体日志等级的值，根据level进行转换
        {
            switch(level)
            {
                case LogLevel::value::DEBUG:return "DEBUG";
                case LogLevel::value::INFO:return "INFO";
                case LogLevel::value::WARN:return "WARN";
                case LogLevel::value::ERROR:return "ERROR";
                case LogLevel::value::FATAL:return "FATAL";
                case LogLevel::value::OFF:return "OFF";
            }
            //如果里面都不是的话，那么直接返回一个UNKONW就行了
            return "UNKONW";
        }
    };
}
#endif